<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.10/vue.js"></script>
</head>
<body>
<div id="app">
    <button @click="handler">修改对象数据</button>
    <ul>
        <li v-for="(value,key) in person" :key="key">
            {{key}} -- {{value}}
        </li>
    </ul>
</div>
<script>
  const vm = new Vue({
    el:"#app",
    data(){
      return{
        person:{
            name:"xiaowan",
            age:12
        }
      }
    },
    methods:{
      handler(){
          //添加一条对象键值对
          // this.$set(this.person,"sex","男")
          //删除一条键值对
          this.$delete(this.person,"age")
      }
    },
  })
</script>
</body>
</html>